package net.onecloud.onecloud.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by zaizai on 16/7/29.
 */
public class ResultUser implements Parcelable {

    private int code;
    private int success;
    private int more;
    private String message;
    private DataEntity data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getSuccess() {
        return success;
    }

    public void setSuccess(int success) {
        this.success = success;
    }

    public int getMore() {
        return more;
    }

    public void setMore(int more) {
        this.more = more;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public DataEntity getData() {
        return data;
    }

    public void setData(DataEntity data) {
        this.data = data;
    }

    public static class DataEntity implements Parcelable {
        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getNickname() {
            return nickname;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String id;
        public String username;
        public String password;
        public String nickname;
        public String phone;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.username);
            dest.writeString(this.password);
            dest.writeString(this.nickname);
            dest.writeString(this.phone);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.id = in.readString();
            this.username = in.readString();
            this.password = in.readString();
            this.nickname = in.readString();
            this.phone = in.readString();
        }

        public static final Creator<DataEntity> CREATOR = new Creator<DataEntity>() {
            @Override
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            @Override
            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.code);
        dest.writeInt(this.success);
        dest.writeInt(this.more);
        dest.writeString(this.message);
        dest.writeParcelable(this.data, flags);
    }

    public ResultUser() {
    }

    protected ResultUser(Parcel in) {
        this.code = in.readInt();
        this.success = in.readInt();
        this.more = in.readInt();
        this.message = in.readString();
        this.data = in.readParcelable(DataEntity.class.getClassLoader());
    }

    public static final Parcelable.Creator<ResultUser> CREATOR = new Parcelable.Creator<ResultUser>() {
        @Override
        public ResultUser createFromParcel(Parcel source) {
            return new ResultUser(source);
        }

        @Override
        public ResultUser[] newArray(int size) {
            return new ResultUser[size];
        }
    };
}
